package ace.cmp.spring.graphql.core.properties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author caspar
 * @date 2023/9/5 15:06
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = GraphqlProperties.PREFIX)
public class GraphqlProperties {
  public static final String PREFIX = "ace.graphql";

  /**
   * global exception controller for handle exception
   */
  @Builder.Default private Boolean enableGlobalExceptionController = true;

  /**
   * extension schema file location
   */
  @Builder.Default
  private List<String> schemaLocations =
      new ArrayList<>(Arrays.asList("classpath*:graphql/**/", "classpath*:graphql/extension/**/"));
}
